const baseURL = import.meta.env.VITE_API_URL || 'http://localhost:8080';
const aiReq = {
  streamReq: (data: any) => {
    // 获取AI聊天的流式响应
    return fetch(baseURL+'/search/query', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: data
    }).then(async response => {
        if (!response.ok) {
          throw new Error('网络错误，无法获取配置文件');
        }
        return response;
      })
  }
}
export default aiReq;